package com.example.vocab.dao;

import com.example.vocab.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao {

    @Select("select * from users where password=#{password} and uid=#{uid}")
    User getUser(User user);

    @Insert("insert into users(uid,username,password) value(#{uid},#{username},#{password})")
    int addUser(User user);

    @Select("select * from users where username=#{username}")
    User selectUser(String username);

    @Select("select * from users where uid=#{uid}")
    User selectUserByUid(User user);


}
